package findjob;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author lidexin
 * @create 2021-10-10 22:45
 */
public class Test2 {
    public static void duplicate(String [] arrStr) {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < arrStr.length; i++) {
            if(!list.contains(arrStr[i])) {
                list.add(arrStr[i]);
            }
        }
        String[] newArrStr = list.toArray(new String[1]);
        System.out.println(Arrays.toString(newArrStr));
    }

    public static void main(String[] args) {
        String[] arrStr = {"a","b","b"};
        duplicate(arrStr);
    }
}
